clear

use "/Users/joonseokyang/Downloads/Drought_check/Drought_final.dta"



*Figure A1
hist prev_monsoon2, graphregion(color(white)) freq color(gs10)

*Table A3
reg c01_2001_area_mean lowdummy_month highdummy_month i.election, vce(cluster election)
reg c01_2001_t_hh_mean lowdummy_month highdummy_month i.election, vce(cluster election)
reg c01_2001_t_p_mean lowdummy_month highdummy_month i.election, vce(cluster election)
reg c01_2001_t_m_mean lowdummy_month highdummy_month i.election, vce(cluster election)
reg c01_2001_t_f_mean lowdummy_month highdummy_month i.election, vce(cluster election)
reg c01_2001_dist_town_mean lowdummy_month highdummy_month i.election, vce(cluster election)
reg c01_2001_p_06_mean lowdummy_month highdummy_month i.election, vce(cluster election)
reg c01_2001_sc_p_mean  lowdummy_month highdummy_month i.election, vce(cluster election)
reg c01_2001_st_p_mean  lowdummy_month highdummy_month i.election, vce(cluster election)
reg c01_2001_p_lit_mean lowdummy_month highdummy_month i.election, vce(cluster election)


*Table A4
reg c01_2001_area_mean lowdummy_ms highdummy_ms i.election, vce(cluster election)
reg c01_2001_t_hh_mean lowdummy_ms highdummy_ms i.election, vce(cluster election)
reg c01_2001_t_p_mean lowdummy_ms highdummy_ms i.election, vce(cluster election)
reg c01_2001_t_m_mean lowdummy_ms highdummy_ms i.election, vce(cluster election)
reg c01_2001_t_f_mean lowdummy_ms highdummy_ms i.election, vce(cluster election)
reg c01_2001_dist_town_mean lowdummy_ms highdummy_ms i.election, vce(cluster election)
reg c01_2001_p_06_mean lowdummy_ms highdummy_ms i.election, vce(cluster election)
reg c01_2001_sc_p_mean lowdummy_ms highdummy_ms i.election, vce(cluster election)
reg c01_2001_st_p_mean lowdummy_ms highdummy_ms i.election, vce(cluster election)
reg c01_2001_p_lit_mean lowdummy_ms highdummy_ms i.election, vce(cluster election)


*Table A5
reg lag_demean_inc_pm demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(id)
reg lag_demean_inc_nonpm demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(id)
reg lag_demean_inc_cm demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(id)
reg lag_demean_inc_noncm demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(id)

*Table A6-A9 : Validation (using separate file)

*Table A10
reg demean_inc demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(id)
reg demean_pm demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(id)
reg demean_cm demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(id)

*Table A11
reg demean_inc_pm demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(id)
reg demean_inc_nonpm demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(id)
reg demean_inc_cm demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(id)
reg demean_inc_noncm demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(id)

*Table A12
reg demean_Turnout demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(id)


*Table A13: Test for Non-linear Relationship in PM- and Non-PM-aligned Incumbents.
*Note: In Table A13, we report p-score based on the two-tailed test.
reg demean_inc_pm demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(id)
utest demean_prev_monsoon2 demean_prev_monsoon2_sq

reg demean_inc_nonpm demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(id)
utest demean_prev_monsoon2 demean_prev_monsoon2_sq

*Table A14: Test for Non-linear Relationship in CM- and Non-CM-aligned Incumbents.
*Note: In Table A14, we report p-score based on the two-tailed test.
reg demean_inc_cm demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(id)
utest demean_prev_monsoon2 demean_prev_monsoon2_sq

reg demean_inc_noncm demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(id)
utest demean_prev_monsoon2 demean_prev_monsoon2_sq


*Table A15
reg demean_inc_pm abs_new1  , r cluster(id)
reg demean_inc_nonpm abs_new1  , r cluster(id)
reg demean_inc_cm abs_new1  , r cluster(id)
reg demean_inc_noncm abs_new1 , r cluster(id)


*Table A16
reg demean_inc demean_prev_monsoon2 demean_prev_monsoon2_sq spei_incumb*, r cluster(id)
reg demean_pm demean_prev_monsoon2 demean_prev_monsoon2_sq spei_incumb*, r cluster(id)
reg demean_cm demean_prev_monsoon2 demean_prev_monsoon2_sq spei_incumb*, r cluster(id)

*Table A17
reg demean_inc_pm demean_prev_monsoon2 demean_prev_monsoon2_sq spei_incumb*, r cluster(id)
reg demean_inc_nonpm demean_prev_monsoon2 demean_prev_monsoon2_sq spei_incumb*, r cluster(id)
reg demean_inc_cm demean_prev_monsoon2 demean_prev_monsoon2_sq spei_incumb*, r cluster(id)
reg demean_inc_noncm demean_prev_monsoon2 demean_prev_monsoon2_sq spei_incumb*, r cluster(id)

*Table A18
reg demean_Turnout demean_prev_monsoon2 demean_prev_monsoon2_sq spei_incumb*, r cluster(id)

*Table A19
reg demean_inc_pm demean_prev_monsoon2 demean_prev_monsoon2_sq demean_N_cand, r cluster(id)
reg demean_inc_nonpm demean_prev_monsoon2 demean_prev_monsoon2_sq demean_N_cand, r cluster(id)
reg demean_inc_cm demean_prev_monsoon2 demean_prev_monsoon2_sq demean_N_cand, r cluster(id)
reg demean_inc_noncm demean_prev_monsoon2 demean_prev_monsoon2_sq demean_N_cand, r cluster(id)
reg demean_Turnout demean_prev_monsoon2 demean_prev_monsoon2_sq demean_N_cand, r cluster(id)

*Table A20
reg demean_inc_pm demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(dist_name)
reg demean_inc_nonpm demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(dist_name)
reg demean_inc_cm demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(dist_name)
reg demean_inc_noncm demean_prev_monsoon2 demean_prev_monsoon2_sq, r cluster(dist_name)

*Table A21
reg demean_inc_cm_gen demean_prev_monsoon2 demean_prev_monsoon2_sq if generalelection==0 & aligned_incumb==0, r cluster(id)

*Table A22 - A23: Spatial (different do file - Final_spatial)

*Table A24 - A27: IHDS analysis

*Table A28 - A32: NREGA

*Table A34
reg demean_v_incc_pm demean_prev_monsoon demean_prev_monsoon2_sq, r cluster(idy)
reg demean_v_no_incc_pm demean_prev_monsoon demean_prev_monsoon2_sq, r cluster(idy)
reg demean_v_incc_cm demean_prev_monsoon demean_prev_monsoon2_sq, r cluster(idy)
reg demean_v_no_incc_cm demean_prev_monsoon demean_prev_monsoon2_sq, r cluster(idy)


*Table A35
gen sample =0
replace sample =  1 if State_name=="andhrapradesh"
replace sample =  1 if State_name=="assam"
replace sample =  1 if State_name=="bihar"
replace sample =  1 if State_name=="gujarat"
replace sample =  1 if State_name=="haryana"
replace sample =  1 if State_name=="karnataka"
replace sample =  1 if State_name=="kerala"
replace sample =  1 if State_name=="madhyapradesh"
replace sample =  1 if State_name=="maharashtra"
replace sample =  1 if State_name=="orissa"
replace sample =  1 if State_name=="punjab"
replace sample =  1 if State_name=="rajasthan"
replace sample =  1 if State_name=="tamilnadu"
replace sample =  1 if State_name=="uttarpradesh"
replace sample =  1 if State_name=="westbengal"

preserve
keep if sample==1 & Year<=2004

reg demean_inc_pm demean_prev_monsoon2 demean_prev_monsoon2_sq demean_inc_p_org, r cluster(id)
reg demean_inc_nonpm demean_prev_monsoon2 demean_prev_monsoon2_sq demean_inc_p_org, r cluster(id)
reg demean_inc_cm demean_prev_monsoon2 demean_prev_monsoon2_sq demean_inc_p_org, r cluster(id)
reg demean_inc_noncm demean_prev_monsoon2 demean_prev_monsoon2_sq demean_inc_p_org, r cluster(id)
restore









